<div id='main'>
  <h1>Book</h1>
  <div class="book-wrapper">
    <img src="{{ relURL "images/progit2.png" }}" width="118" height="157"/>
    <div style="light">2nd Edition (2014)</div>
    {{ if (or (isset .Params.book "ebook_pdf") (isset .Params.book "ebook_epub") (isset .Params.book "ebook_mobi")) }}
      <div class="ebook-download">
        <h2>Download Ebook</h2>
        <div class="ebooks">
          {{ if isset .Params.book "ebook_pdf" }}
            <a href="{{ .Params.book.ebook_pdf }}"><img width="50px" src="{{ relURL "images/pdf.png" }}"/></a>
          {{ end }}
          {{ if .Params.book.ebook_epub }}
            <a href="{{ .Params.book.ebook_epub }}"><img width="50px" src="{{ relURL "images/epub.png" }}"/></a>
          {{ end }}
        </div>
        <div class="ebooks">
          {{ if .Params.book.ebook_mobi }}
            <a href="{{ .Params.book.ebook_mobi }}"><img width="50px" src="{{ relURL "images/mobi.png" }}"/></a>
          {{ end }}
        </div>
      </div>
      {{ end }}
     </div>
  <p>
  The entire Pro Git book, written by Scott Chacon and Ben Straub and published by Apress, is available here. All content is licensed under the <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution Non Commercial Share Alike 3.0 license</a>. Print versions of the book are available on <a href="https://www.amazon.com/Pro-Git-Scott-Chacon/dp/1484200772?ie=UTF8&camp=1789&creative=9325&creativeASIN=1430218339&linkCode=as2&tag=git-sfconservancy-20">Amazon.com</a>.
  </p>

  <p>The version found here has been updated with corrections and additions from <a href="https://github.com/progit/progit2/graphs/contributors">hundreds of contributors</a>. If you see an error or have a suggestion, patches and issues are welcome in its <a href="https://github.com/progit/progit2">GitHub repository</a>.
  </p>

  <ol class='book-toc'>
    {{ range (index (.Scratch.Get "book") "chapters") }}
    {{ $section_count := .sections | len }}
    {{ if (ne $section_count 0) }}
    <li class='chapter'>
    <h2>{{ .cs_number }}. <a href="{{ relURL (replace (index (index .sections 0) "url") "?" "%3F") }}">{{ .title }}</a></h2>
      <ol>
        {{ range .sections }}
          {{ if (ne .title "") }}
            <li>
              {{ .cs_number }}
              <a href="{{ relURL (replace .url "?" "%3F") }}">{{ .title }}</a>
            </li>
          {{ end }}
        {{ end }}
      </ol>
    </li>
    {{ end }}
    {{ end }}
  </ol>
</div>
